{__NOLAYOUT__}
<include file="Public/meta"/>
        
        

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <button class="btn btn-primary" id="submit"><i class="icon-save"></i> 提交</button>
    <!-- <a href="#myModal" data-toggle="modal" class="btn">删除</a> -->
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab">
        <label>分类名称</label>
        <input type="text" value="" class="input-xlarge" id="catename" name="catename">
        
        

        <label>父级分类</label>
        <select name="pid" id="pid" class="input-xlarge">
          <option value="0">==请选择==</option>
          <volist name="cate_list" id="va">
            <option value="{$va.cate_id}">{$va.catename}</option>
          </volist>
        </select>
    </form>
      </div>
      <div class="tab-pane fade" id="profile">
    <form id="tab2">
        <label>New Password</label>
        <input type="password" class="input-xlarge">
        <div>
            <button class="btn btn-primary">Update</button>
        </div>
    </form>
      </div>
  </div>

</div>

<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Delete Confirmation</h3>
  </div>
  <div class="modal-body">
    
    <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button class="btn btn-danger" data-dismiss="modal">Delete</button>
  </div>
<!-- </div> -->



<script type="text/javascript">

  function cateblur(){
      var catename = $('#catename').val();
      if(catename==''){
        layer.msg('分类名称不可为空',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }



  $('#catename').blur(function(){
      cateblur();
  })



  $("#submit").click(function(){
      

      //提交前确认信息无误
      if(cateblur()){
        
        
        $.post("",$("#tab").serialize(),function(msg){
            if(msg.code=='1'){
              layer.msg(msg.info,{icon:1,time:1000},function(){
                
                window.parent.location.reload();

              });

            }else{
              layer.msg(msg.info,{icon:2,time:1000});
              return false;
            }
            
        })
             
      }               
      
  })
  
</script>